# Maintainer: David Runge <dvzrv@archlinux.org>

_name=flufl.bounce
pkgname=python-flufl.bounce
pkgver=4.0
pkgrel=4
pkgdesc="Email bounce detectors"
arch=('any')
url="https://fluflbounce.readthedocs.io/en/latest/"
license=('Apache')
depends=('python-atpublic' 'python-zope-interface')
makedepends=('python-setuptools')
checkdepends=('python-pytest')
provides=('python-flufl-bounce')
replaces=('python-flufl-bounce')
source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/${_name}-${pkgver}.tar.gz")
sha512sums=('c6dd8cf2f4f0ea7c8698054042dfc9da3bd1a2d9cae082e01a0be9c39018fefba07154e2c9c15b1a00c896e58bb0a6d2063a3c067bec6b464d201bb7b3220e9e')
b2sums=('00c9d69d0aab3a4ca6f781dbd32bcc00d33de59371a163589f8be1747144f6cb9f51da57152235cfbc08ded63894402669c0ba4745eeb3c7b60c95cccf6206c7')

prepare() {
  mv -v "${_name}-${pkgver}" "$pkgname-$pkgver"
  cd "$pkgname-$pkgver"
}

build() {
  cd "$pkgname-$pkgver"
  python setup.py build
}

check() {
  cd "$pkgname-$pkgver"
  export PYTHONPATH="build:${PYTHONPATH}"
  pytest -v
}

package() {
  cd "$pkgname-$pkgver"
  python setup.py install --skip-build \
    --optimize=1 \
    --root="${pkgdir}"
  install -vDm 644 README.rst -t "${pkgdir}/usr/share/doc/${pkgname}"
}
